package view;

import javax.swing.JDialog;
import java.awt.Color;
import javax.swing.JPanel;
import javax.swing.GroupLayout.Alignment;
import javax.swing.GroupLayout;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JButton;
import javax.swing.JTabbedPane;
import javax.swing.JTextField;

public class ViewCadastroEmpresa extends JDialog {

	private javax.swing.JPanel jPanelSuperior = new javax.swing.JPanel();
	private JTextField txt_nomeEmpresa;
	
	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		try {
			ViewCadastroEmpresa dialog = new ViewCadastroEmpresa();
			dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
			dialog.setVisible(true);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Create the dialog.
	 */
	public ViewCadastroEmpresa() {
		
		setTitle(".:. Cadastro de Empresas .:.");
		
		getContentPane().setBackground(Color.WHITE);

		java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
		setBounds((screenSize.width-800)/2, (screenSize.height-440)/2, 800, 440);
		
		JLabel lblCadastroDeEmpresas = new JLabel("Cadastro de Empresas");
		lblCadastroDeEmpresas.setForeground(Color.WHITE);
		lblCadastroDeEmpresas.setFont(new Font("Tahoma", Font.PLAIN, 25));
		
		// A partir daqui comandos para que o elemento JPanel redimensione o seu tamanho de acordo
		// com o tamanho do redimensionamento do frame

		javax.swing.GroupLayout gl_jPanelSuperior = new javax.swing.GroupLayout(jPanelSuperior);
		gl_jPanelSuperior.setHorizontalGroup(
			gl_jPanelSuperior.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_jPanelSuperior.createSequentialGroup()
					.addGap(23)
					.addComponent(lblCadastroDeEmpresas)
					.addContainerGap(515, Short.MAX_VALUE))
		);
		gl_jPanelSuperior.setVerticalGroup(
			gl_jPanelSuperior.createParallelGroup(Alignment.LEADING)
				.addGroup(Alignment.TRAILING, gl_jPanelSuperior.createSequentialGroup()
					.addContainerGap(27, Short.MAX_VALUE)
					.addComponent(lblCadastroDeEmpresas)
					.addGap(23))
		);
		jPanelSuperior.setLayout(gl_jPanelSuperior);
		jPanelSuperior.setBackground(new java.awt.Color(70, 65, 107));
		
		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		
		JPanel panel_2 = new JPanel();
		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
		layout.setHorizontalGroup(
			layout.createParallelGroup(Alignment.TRAILING)
				.addComponent(jPanelSuperior, GroupLayout.DEFAULT_SIZE, 785, Short.MAX_VALUE)
				.addComponent(panel_2, GroupLayout.DEFAULT_SIZE, 785, Short.MAX_VALUE)
				.addGroup(Alignment.LEADING, layout.createSequentialGroup()
					.addGap(38)
					.addComponent(tabbedPane, GroupLayout.PREFERRED_SIZE, 700, GroupLayout.PREFERRED_SIZE)
					.addContainerGap(48, Short.MAX_VALUE))
		);
		layout.setVerticalGroup(
			layout.createParallelGroup(Alignment.LEADING)
				.addGroup(layout.createSequentialGroup()
					.addComponent(jPanelSuperior, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
					.addGap(18)
					.addComponent(tabbedPane, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE)
					.addPreferredGap(ComponentPlacement.RELATED, 25, Short.MAX_VALUE)
					.addComponent(panel_2, GroupLayout.PREFERRED_SIZE, 38, GroupLayout.PREFERRED_SIZE))
		);
		
		JPanel panel = new JPanel();
		tabbedPane.addTab("Cadastro", null, panel, null);
		panel.setLayout(null);
		
		JLabel lblNomeDaEmpresa = new JLabel("Nome da Empresa:");
		lblNomeDaEmpresa.setFont(new Font("SansSerif", Font.PLAIN, 14));
		lblNomeDaEmpresa.setBounds(101, 37, 128, 22);
		panel.add(lblNomeDaEmpresa);
		
		txt_nomeEmpresa = new JTextField();
		txt_nomeEmpresa.setBounds(241, 35, 327, 28);
		panel.add(txt_nomeEmpresa);
		txt_nomeEmpresa.setColumns(10);
		
		JButton btnCadastrar = new JButton("Cadastrar");
		btnCadastrar.setBounds(478, 75, 90, 28);
		panel.add(btnCadastrar);
		
		JButton btnLimpar = new JButton("Limpar");
		btnLimpar.setBounds(376, 75, 90, 28);
		panel.add(btnLimpar);
		
		JPanel panel_1 = new JPanel();
		tabbedPane.addTab("Listagem", null, panel_1, null);
		panel_1.setLayout(null);
		
		getContentPane().setLayout(layout);
		
		this.setModal(true); // Para Bloquear o acesso ao Frame Principal
		
	}
}
